home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12641 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  909 b 

  1. Path: news.nas.com!news
  2. From: gldnspud@kali.nas.com (Matt Scott)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: beginner question
  5. Date: Tue, 02 Apr 1996 02:07:28 GMT
  6. Organization: Everyone's Software
  7. Message-ID: <4jq27c$lcb@barad-dur.nas.com>
  8. References: <4jc3sr$1ggu@uvaix3e1.comp.UVic.CA> <4jdo7l$de2@sparcserver.lrz-muenchen.de> <315AFED2.7466@willows.com>
  9. NNTP-Posting-Host: kali.nas.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Tarang Deshpande <tarang@willows.com> wrote:
  13.  
  14. >So then what does the following mean:
  15.  
  16. >struct _FOO
  17. >{
  18. >    int    bar;
  19. >} FOO;
  20.  
  21. >struct _FOO s1;
  22. >FOO         s2;
  23.  
  24. This would first define a variable FOO of type struct _FOO. It would
  25. then define a variable s1 of type struct _FOO. However, the last line
  26. would be illegal to the best of my knowledge.
  27.  
  28. If you inserted a typedef in front of the struct line:
  29.  
  30. typedef struct _FOO
  31.     {
  32.     int bar;
  33.     } FOO;
  34.  
  35. then the last line would become legal.
  36.  
  37. -matt
  38.  
  39.